package org.test.udp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {
	    private static String localhost="localhost";

	    public static void main(String[] args) throws UnknownHostException, IOException {
	        Socket s = new Socket(localhost, 8080);
	        PrintWriter out=new PrintWriter(s.getOutputStream(),true);  
	           
	        out.println(ReadTxt.txtToString("D:\\test.txt"));
	  
	        out.println();  
	        BufferedReader bufr=new BufferedReader(new InputStreamReader(s.getInputStream()));  
	  
	        String line=null;  
	        while((line=bufr.readLine())!=null)  
	            System.out.println(line);  
	        s.close();  
	    }
	}
